#!/usr/bin/bash

# variables
config=$HOME/.config/hypr
scripts=$HOME/.config/hypr/scripts

# wallpaper
$scripts/wall ~/.config/wallpapers/my/conv-gamer_girl.png &

# notification daemon
if [[ ! `pidof dunst` ]]; then
        dunst &
fi

# waybar
function launch_waybar {
    waybar -c $config/component/waybar/config.jsonc -s $config/component/waybar/style.css &
}

if [[ ! `pidof waybar` ]]; then
       launch_waybar 
fi

# autentification agent
if [[ ! `pidof xfce-polkit` ]]; then
        /usr/lib/xfce-polkit/xfce-polkit &
fi

# sound
if [[ ! `pidof pipewire` ]]; then
        pipewire & pipewire-pulse & wireplumber &
fi

# mpd
if [[ ! `pidof mpd` ]]; then
  mpd ~/.config/mpd/mpd.conf & mpDris2 -c ~/.config/mpDris2/mpDris2.conf &
fi

# desktop portal
if [[ ! `pidof xdg-desktop-portal-wlr` ]]; then
  /usr/lib/xdg-desktop-portal-wlr &
fi

# themes
gsettings set org.gnome.desktop.interface gtk-theme 'Catppuccin-Mocha-Standard-Mauve-Dark'
gsettings set org.gnome.desktop.interface icon-theme 'ePapirus-Dark'
gsettings set org.gnome.desktop.interface cursor-theme 'LyraQ-cursors'
MOZ_ENABLE_WAYLAND=1
notify-send "restarted"
